from PyInstaller.utils.hooks import collect_all, collect_submodules, collect_data_files

# 收集 edge_tts 的所有依赖
datas, binaries, hiddenimports = collect_all('edge_tts')

# 额外添加可能缺失的隐藏导入
hiddenimports += [
    'edge_tts.communicate',
    'edge_tts.list_voices',
    'edge_tts.edge_tts',
    'azure.cognitiveservices.speech',
    'websockets',
    'websockets.legacy',
    'websockets.legacy.auth',
    'websockets.legacy.protocol',
    'websockets.legacy.server',
    'websockets.legacy.client',
    'ssl',
    'http',
    'http.client',
    'urllib3',
    'urllib3.util',
    'urllib3.contrib',
    'urllib3.contrib.pyopenssl',
    'asyncio',
    'asyncio.events',
    'asyncio.tasks',
    'asyncio.base_events',
    'asyncio.unix_events',
    'asyncio.windows_events',
    'encodings.utf_8',
    'encodings.ascii',
    'encodings.idna',
]

# 如果你需要包含额外的数据文件，可以使用：
# datas += collect_data_files('edge_tts')